package com.depth.viewer.request
{
	import mx.rpc.IResponder;
	
	public class PoolResponder implements IResponder
	{
		private var _result:Function;
		private var _fault:Function;
		private var _data:Object;
		private var _id:String;
		
		public function PoolResponder(resuleFunction:Function,faultFunction:Function)
		{
			this._result = resuleFunction;
			this._fault =faultFunction
		}
		
		public function result(value:Object):void
		{
			ConnectionPoolUtil.instance.sumOfError = 0;
			data?_result(value.result,data):_result(value.result);
		}
		
		public function fault(info:Object):void
		{
			_fault(info,id);
		}

		public function get data():Object
		{
			return _data;
		}

		public function set data(value:Object):void
		{
			_data = value;
		}

		/**
		 * 这个连接的Id
		 * */
		public function get id():String
		{
			return _id;
		}

		/**
		 * @private
		 */
		public function set id(value:String):void
		{
			_id = value;
		}


	}
}